# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>
# Contributor: Sergej Pupykin <pupykin.s+arch@gmail.com>
# Contributor: Jaroslaw Swierczynski <swiergot@aur.archlinux.org>
# Contributor: Eric Belanger <belanger@astro.umontreal.ca>
# Contributor: Bob Finch <w9ya@arrl.net>

pkgname=dosemu
pkgver=1.4.0.8+753+g18f6f5cd
pkgrel=3
epoch=1
pkgdesc='DOS emulator'
url='http://www.dosemu.org/'
arch=('loong64' 'x86_64')
license=('GPL' 'custom')
depends=('gpm' 'slang' 'sdl' 'libxxf86vm' 'libsndfile' 'alsa-lib')
makedepends=('git' 'xorg-mkfontdir' 'xorg-bdftopcf' 'gendesk' 'imagemagick')
backup=('etc/dosemu/dosemu.conf'
        'etc/dosemu/dosemu.users'
        'etc/dosemu/global.conf')
source=(${pkgname}::git://git.code.sf.net/p/dosemu/code#commit=18f6f5cdf1beceae8c7532718bfaf423e4a44f6a
        https://downloads.sourceforge.net/sourceforge/dosemu/dosemu-freedos-1.0-bin.tgz)
sha512sums=('SKIP'
            'd0c4235ceac55de63ce5f72e51b7d57a82b8104f4bf2df6f4dc25c9889d3337b40d75665c2dfc98492ec7123e0959a725f5c7579e145895024bd80a07036e3bd')

pkgver() {
  cd ${pkgname}
  git describe --tags --always|sed 's/^dosemu-//;s/-/+/g'
}

prepare() {
  cd ${pkgname}
  gendesk -n \
    --pkgname=${pkgname} \
    --pkgdesc='dos emulator' \
    --categories='system;emulator'
}

build() {
  cd ${pkgname}
  ./configure \
    --prefix=/usr \
    --with-fdtarball="${srcdir}/dosemu-freedos-1.0-bin.tgz" \
    --mandir=/usr/share/man
  make
}

package(){
  cd ${pkgname}
  make DESTDIR="${pkgdir}" install
  install -d "${pkgdir}"/usr/share/pixmaps
  convert +set date:create +set date:modify etc/${pkgname}.xpm "${pkgdir}/usr/share/pixmaps/${pkgname}.png"
  install -D -m 644 ${pkgname}.desktop -t "${pkgdir}/usr/share/applications"
  install -D -m 644 COPYING COPYING.DOSEMU -t "${pkgdir}/usr/share/licenses/${pkgname}"
}

# vim: ts=2 sw=2 et:
